//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

package inet.applications.stemNetStimulus;

import inet.applications.IUDPApp;

module StemNetStimulusApp like IUDPApp
{
    parameters:
        
    gates:
        input udpIn @labels(UDPControlInfo/up);
        output udpOut @labels(UDPControlInfo/down);

    submodules:
        brain: StemNetStimulusBrain {
            @display("p=128,213;i=personal/brain");
        }

        db: KnowledgeRepository {
            @display("p=128,123;i=abstract/db");
        }

        coop: CooperativeManager {
            @display("p=59,62;i=abstract/people_l");
        }

        policy: PolicyManager {
            @display("p=201,62;i=block/cogwheel");
        }

        emulate3G: Emulate3G {
            @display("p=201,213;i=block/wtx");
        }

    connections:
        // Connections between KnowledgeRepository and CooperativeManager
        db.cooperationIn <-- coop.controlOut;
        db.cooperationOut --> coop.controlIn;

        // Connections between KnowledgeRepository and PolicyManager
        db.policyIn <-- policy.controlOut;
        db.policyOut --> policy.controlIn;

        // Connections between KnowledgeRepository and StemNetStimulusBrain
        db.brainIn <-- brain.dbOut;
        db.brainOut --> brain.dbIn;

        // Connections between StemNetStimulusBrain and Dummy3G
        brain.dummy3GIn <-- emulate3G.dataOut;
        brain.dummy3GOut --> emulate3G.dataIn;

        // Connections between StemNetStimulusBrain and lowerDummy3G in/out and udp in/out
        brain.udpIn <-- udpIn;
        brain.udpOut --> udpOut;
}
